	use "C:\Users\Andy baker\OneDrive - UCB-O365\My Documents\Research\Paper Book Networks\Chapter 4 Campaigns\Data\Chapter 4 net traits all four pred probs.dta", clear

gen upper=pointestimate+1.96*se
gen lower=pointestimate-1.96*se
gen label=0

gen n=_n
replace n=21-n

*FIGURE 4.3
twoway (scatter  n pointestimate if n>15.5, mcolor(black))  (rcap upper lower n if n>15.5, color(black) horizontal ) ///
(scatter  n pointestimate if n>10.5 & n<15.5, mcolor(black) msym(S))  (rcap upper lower n if n>10.5 & n<15.5, color(black) msym(S) horizontal ) ///
(scatter  n pointestimate if n>5.5 & n<10.5, mcolor(black) msym(t))  (rcap upper lower n if n>5.5 & n<10.5, color(black) msym(t) horizontal ) ///
(scatter  n pointestimate if n<5.5, mcolor(black) msym(D))  (rcap upper lower n if n<5.5, color(black) msym(D) horizontal ) , ///
xtitle("{bf:Model-Predicted Probability of Switching}") ///
title("{bf:Dependent Variable: Changed Vote Preference}", color(black) size(medsmall)) ///
graphregion(color(white)) plotregion(lstyle(yxline) lcolor(black)) ytitle("{bf:Country, Year, and Network Type}") ///
legend(off) ymlab(20 "Disagreement only (homog.)" 19 "Disagreement only (heterog.)" 18 "Disagreement & agreement" 17 "Singleton" 16 "Agreement only" ///
15 "Disagreement only (homog.)" 14 "Disagreement only (heterog.)" 13 "Disagreement & agreement" 12 "Singleton" 11 "Agreement only"  ///
10 "Disagreement only (homog.)" 9 "Disagreement only (heterog.)" 8 "Disagreement & agreement" 7 "Singleton" 6 "Agreement only" ///
 5 "Disagreement only (homog.)" 4 "Disagreement only (heterog.)" 3 "Disagreement & agreement" 2 "Singleton" 1 "Agreement only"  , labsize(small) angle(horizontal)) ///
ylab(18 "Brazil 2002" 13 "Brazil 2006" 8 "Brazil 2014"  3 "Mexico 2006 ", angle(vertical) notick nogrid labgap(38)) ///
ytick(5.5 10.5 15.5, tlength(42)) xlab(0 .2 .4 .6, grid) yline(5.5 10.5 15.5, lcolor(black)) ///
text(3 .045 "{it:N}=1,043", size(small)) text(8 .045 "{it:N}=710", size(small)) ///
text(13 .045 "{it:N}=1,184", size(small)) text(18 .045 "{it:N}=2,278", size(small)) 

graph export "C:\Users\Andy baker\OneDrive - UCB-O365\My Documents\Research\Paper Book Networks\Chapter 4 Campaigns\Figures\Net traits pred probs.tif", as(tif) replace
graph export "C:\Users\Andy baker\OneDrive - UCB-O365\My Documents\Research\Paper Book Networks\Publishers\Final Manuscript\Final Figures\BAR4_3.tif", as(tif) replace width(1500)
graph export "C:\Users\Andy baker\OneDrive - UCB-O365\My Documents\Research\Paper Book Networks\Publishers\Final Manuscript\Final Figures\BAR4_3.pdf", as(pdf) replace 
